import React, { useEffect, useState } from "react";
import { Form, InputNumber, message, notification, Select, Checkbox, Input, Button, Upload } from "antd";
import { CommonModal } from "@/views/components/CommonModal";
import CommonLoading from "@/components/CommonLoading";
import { manualDelivery, batchPrintByQualifiedOutbound, getCoFcTemplateByIdsOutbound } from "../service";
import { printCard } from "@/utils/print.jsx";
// import {
// 	checkComponentsIsOpen,
// 	getAllPrinter,
// 	judgeHasWhichPlatform,
// 	print,
// 	printCheckList,
// 	printVipShop
// } from "@/utils/print.jsx";
import styles from "./index.module.less";

import { setPrinterName, getPrinterName, getCurrentUser } from "@/utils/authority";
import { hiprint } from "vue-plugin-hiprint";
import { getAllPrinter } from "@/utils/print.jsx";
import { isEmpty } from "lodash";

import ManualShipment from "./ManualShipment";
import TrackNumDom from "./TrackNumDom.jsx";
import OperateDeliveryDom from "./OperateDeliveryDom.jsx";
import CertificatePrintDom from "./CertificatePrintDom.jsx";

const Modal = ({ visible, title, modelType, ids, checkedRows, onOk, onCancel, width = "520px" }) => {
	const [loading, setLoading] = useState(false);

	return (
		<CommonModal title={{ title }} visible={visible} onCancel={onCancel} onOk={handleOk} width={width}>
			<Form name="send-goods-modal" form={form}>
				{modelType === "manualShipment" && <ManualShipment />}
				{modelType === "getTrackNum" && <TrackNumDom />}
				{modelType === "certificatePrint" && <CertificatePrintDom />}
			</Form>
			<CommonLoading loading={loading} />
		</CommonModal>
	);
};

export default Modal;
